diff options
Diffstat (limited to 'pages/anime/watch/[...info].js')
| -rw-r--r-- | pages/anime/watch/[...info].js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/pages/anime/watch/[...info].js b/pages/anime/watch/[...info].js index 0b2bd35..d77c23c 100644 --- a/pages/anime/watch/[...info].js +++ b/pages/anime/watch/[...info].js @@ -67,11 +67,17 @@ export default function Info({ sessions, id, aniId }) { // setLoading(true); let epiFallback = null; - const res = await fetch( - `https://api.moopa.my.id/meta/anilist/watch/${id}` - ); - const epiData = await res.json(); - setEpiData(epiData); + try { + const res = await fetch( + `https://api.moopa.my.id/meta/anilist/watch/${id}` + ); + const epiData = await res.json(); + setEpiData(epiData); + } catch (error) { + setTimeout(() => { + window.location.reload(); + }, 3000); + } const res2 = await fetch( `https://api.moopa.my.id/meta/anilist/info/${aniId}` |